# This is a sample Python script.

# Press ⇧⌘F11 to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.


from openai import OpenAI

# client = OpenAI(api_key="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")
# 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
client = OpenAI(api_key="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")

#
# role:
# system:前提（系统设置）
# asistant：对方(ai),
# user:你
completion = client.chat.completions.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "system", "content": "你是一个高中历史老师"},
    {"role": "user", "content": "如何评价南北朝"}
  ]
)


print(completion.choices[0].message)